package com.zsk.shop.enums;

/**
 * @author Ys
 * @date 2021年11月22日 16:38
 */
public enum EnumOrderPointsStatus {

    DEFAULT("默认", 0),

    WAIT("待解冻", 1),

    SUCCESS("已解冻", 2),

    USE("已使用", 3),
    ;

    private String name;
    private Integer code;

    EnumOrderPointsStatus(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static String getNameByCode(Integer code) {
        EnumOrderPointsStatus[] enums = EnumOrderPointsStatus.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getName();
            }
        }
        return "";
    }
}